agora inbox for [email protected]help / color / mirror / Atom feed
room for improvement in amcheck btree checking? 971+ messages / 4 participants [nested] [flat]
* room for improvement in amcheck btree checking? @ 2020-12-01 20:39 Mark Dilger <[email protected]> 0 siblings, 2 replies; 971+ messages in thread From: Mark Dilger @ 2020-12-01 20:39 UTC (permalink / raw) To: pgsql-hackers; +Cc: Peter Geoghegan <[email protected]> Peter, While working on the pg_amcheck code for [1], I discovered an unexpected deficiency in the way btree indexes are checked. So far as I can tell from the docs [2], the deficiency does not violate any promises that amcheck is making, but I found it rather surprising all the same. To reproduce: 1) Create a (possibly empty) table and btree index over the table. 2) Flush buffers and backup a copy of the heap relation file. 3) Load (more) data into the table. 4) Flushing buffers as needed, revert the heap relation file to the backup previously taken. 5) Run bt_index_check and bt_index_parent_check with and without heapallindexed and/or rootdescend. Note that the index passes all checks. 6) Run a SQL query that uses a sequential scan on the table and observe no errors. 7) Run a SQL query that uses an index scan on the table and see that it errors with something like: ERROR: could not read block 0 in file "base/13097/16391": read only 0 of 8192 bytes I found it surprising that even when precisely zero of the tids in the index exist in the table the index checks all come back clean. The heapallindexed check is technically running as advertised, checking that all of the zero tuples in the heap are present in the index. That is a pretty useless check under this condition, though. Is a "indexallheaped" option (by some less crazy name) needed? Users might also run into this problem when a heap relation file gets erroneously shortened by some number of blocks but not fully truncated, or perhaps with torn page writes. Have you already considered and rejected a "indexallheaped" type check? Background ------- I have up until recently been focused on corruption caused by twiddling the bits within heap and index relation pages, but real-world user error, file system error, and perhaps race conditions in the core postgresql code seem at least as likely to result in missing or incorrect versions of blocks of relation files rather than individual bytes within those blocks being wrong. Per our discussions in [3], not all corruptions that can be created under laboratory conditions are equally likely to occur in the wild, and it may be reasonable to only harden the amcheck code against corruptions that are more likely to happen in actual practice. To make it easier for tap tests to cover common corruption type scenarios, I have been extending PostgresNode.pm with functions to perform these kinds of file system corruptions. I expect to post that work in another thread soon. I am not embedding any knowledge of the internal structure of heap, index, or toast relations in PostgresNode, only creating functions to archive versions of files and perform full or partial reversions of them later. The ultimate goal of this work is to have sufficient regression tests to demonstrate that pg_amcheck can be run with default options against a system corrupted in these common ways without crashing, and with reasonable likelihood of detecting these common corruptions. Users might understand that hard to detect corruption will go unnoticed, but it would be harder to explain to them why, immediately after getting a clean bill of health on their system, a query bombed out with the sort of error shown above. [1] https://commitfest.postgresql.org/31/2670/ [2] https://www.postgresql.org/docs/13/amcheck.html [3] https://www.postgresql.org/message-id/flat/CAH2-WznaU6HcahLV4Hg-DnhEmW8DuSdYfn3vfWXoj3Me9jq%3DsQ%40m... — Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company ^ permalink raw reply [nested|flat] 971+ messages in thread
* Re: room for improvement in amcheck btree checking? @ 2020-12-01 23:26 Alvaro Herrera <[email protected]> parent: Mark Dilger <[email protected]> 1 sibling, 0 replies; 971+ messages in thread From: Alvaro Herrera @ 2020-12-01 23:26 UTC (permalink / raw) To: Mark Dilger <[email protected]>; +Cc: pgsql-hackers; Peter Geoghegan <[email protected]> On 2020-Dec-01, Mark Dilger wrote: > 7) Run a SQL query that uses an index scan on the table and see that it errors with something like: > > ERROR: could not read block 0 in file "base/13097/16391": read only 0 of 8192 bytes > > I found it surprising that even when precisely zero of the tids in the > index exist in the table the index checks all come back clean. Yeah, I've seen this kind of symptom in production databases (indexes pointing to non-existant heap pages). I think one useful cross-check that amcheck could do, is verify that if a heap page is referenced from the index, then the heap page must exist. Otherwise, it's a future index corruption of sorts: the old index entries will point to the wrong new heap tuples as soon as the table grows again. ^ permalink raw reply [nested|flat] 971+ messages in thread
* Re: room for improvement in amcheck btree checking? @ 2020-12-02 00:38 Peter Geoghegan <[email protected]> parent: Mark Dilger <[email protected]> 1 sibling, 1 reply; 971+ messages in thread From: Peter Geoghegan @ 2020-12-02 00:38 UTC (permalink / raw) To: Mark Dilger <[email protected]>; +Cc: pgsql-hackers On Tue, Dec 1, 2020 at 12:39 PM Mark Dilger <[email protected]> wrote: > I found it surprising that even when precisely zero of the tids in the index exist in the table the index checks all come back clean. The heapallindexed check is technically running as advertised, checking that all of the zero tuples in the heap are present in the index. That is a pretty useless check under this condition, though. Is a "indexallheaped" option (by some less crazy name) needed? > > Users might also run into this problem when a heap relation file gets erroneously shortened by some number of blocks but not fully truncated, or perhaps with torn page writes. It would probably be possible to detect this exact condition (though not other variants of the more general problem) relatively easily. Perhaps by doing something with RelationOpenSmgr() with the heap relation, while applying a little knowledge of what must be true about the heap relation given what is known about the index relation. (I'm not 100% sure that that's possible, but offhand it seems like it probably is.) See also: commit 6754fe65a4c, which tightened things up in this area for the index relation itself. > Have you already considered and rejected a "indexallheaped" type check? Actually, I pointed out that we should do something along these lines very recently: https://postgr.es/m/CAH2-Wz=dy--FG5iJ0kPcQumS0W5g+xQED3t-7HE+UqAK_hmLTw@mail.gmail.com I'd be happy to see you pursue it. > Background > ------- > > I have up until recently been focused on corruption caused by twiddling the bits within heap and index relation pages, but real-world user error, file system error, and perhaps race conditions in the core postgresql code seem at least as likely to result in missing or incorrect versions of blocks of relation files rather than individual bytes within those blocks being wrong. Per our discussions in [3], not all corruptions that can be created under laboratory conditions are equally likely to occur in the wild, and it may be reasonable to only harden the amcheck code against corruptions that are more likely to happen in actual practice. Right. I also like to harden amcheck in ways that happen to be easy, especially when it seems like it might kind of work as a broad defense that doesn't consider any particular scenario. For example, hardening to make sure the an index tuple's lp_len matches IndexTupleSize() for the tuple proper (this also kind of works as storage format documentation). I am concerned about both costs and benefits. FWIW, this is a perfect example of the kind of hardening that makes sense to me. Clearly this kind of failure is a reasonably plausible scenario (probably even a known real world scenario with catalog corruption), and clearly we could do something about it that's pretty simple and obviously low risk. It easily meets the standard that I might apply here. -- Peter Geoghegan ^ permalink raw reply [nested|flat] 971+ messages in thread
* Re: room for improvement in amcheck btree checking? @ 2020-12-02 02:03 Mark Dilger <[email protected]> parent: Peter Geoghegan <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Mark Dilger @ 2020-12-02 02:03 UTC (permalink / raw) To: Peter Geoghegan <[email protected]>; +Cc: pgsql-hackers > On Dec 1, 2020, at 4:38 PM, Peter Geoghegan <[email protected]> wrote: > > On Tue, Dec 1, 2020 at 12:39 PM Mark Dilger > <[email protected]> wrote: >> I found it surprising that even when precisely zero of the tids in the index exist in the table the index checks all come back clean. The heapallindexed check is technically running as advertised, checking that all of the zero tuples in the heap are present in the index. That is a pretty useless check under this condition, though. Is a "indexallheaped" option (by some less crazy name) needed? >> >> Users might also run into this problem when a heap relation file gets erroneously shortened by some number of blocks but not fully truncated, or perhaps with torn page writes. > > It would probably be possible to detect this exact condition (though > not other variants of the more general problem) relatively easily. > Perhaps by doing something with RelationOpenSmgr() with the heap > relation, while applying a little knowledge of what must be true about > the heap relation given what is known about the index relation. (I'm > not 100% sure that that's possible, but offhand it seems like it > probably is.) > > See also: commit 6754fe65a4c, which tightened things up in this area > for the index relation itself. Yes, some of the test code I've been playing with already hit the error messages introduced in that commit. >> Have you already considered and rejected a "indexallheaped" type check? > > Actually, I pointed out that we should do something along these lines > very recently: > > https://postgr.es/m/CAH2-Wz=dy--FG5iJ0kPcQumS0W5g+xQED3t-7HE+UqAK_hmLTw@mail.gmail.com Right. > I'd be happy to see you pursue it. I'm not sure how much longer I'll be pursuing corruption checkers before switching to another task. Certainly, I'm interested in pursuing this if time permits. >> Background >> ------- >> >> I have up until recently been focused on corruption caused by twiddling the bits within heap and index relation pages, but real-world user error, file system error, and perhaps race conditions in the core postgresql code seem at least as likely to result in missing or incorrect versions of blocks of relation files rather than individual bytes within those blocks being wrong. Per our discussions in [3], not all corruptions that can be created under laboratory conditions are equally likely to occur in the wild, and it may be reasonable to only harden the amcheck code against corruptions that are more likely to happen in actual practice. > > Right. I also like to harden amcheck in ways that happen to be easy, > especially when it seems like it might kind of work as a broad > defense that doesn't consider any particular scenario. For example, > hardening to make sure the an index tuple's lp_len matches > IndexTupleSize() for the tuple proper (this also kind of works as > storage format documentation). I am concerned about both costs and > benefits. > > FWIW, this is a perfect example of the kind of hardening that makes > sense to me. Clearly this kind of failure is a reasonably plausible > scenario (probably even a known real world scenario with catalog > corruption), and clearly we could do something about it that's pretty > simple and obviously low risk. It easily meets the standard that I > might apply here. Ok, it seems we're in general agreement about that. — Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
* [PATCH 3/9] remove excess parens around ereport @ 2026-03-12 15:09 Álvaro Herrera <[email protected]> 0 siblings, 0 replies; 971+ messages in thread From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw) --- src/backend/commands/cluster.c | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index db3980b84f5..af47354e382 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for catalog relations."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for catalog relations.")); /* * reorderbuffer.c does not seem to handle processing of TOAST relation @@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) */ if (IsToastRelation(rel)) ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."))); + errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")); relpersistence = rel->rd_rel->relpersistence; if (relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("REPACK CONCURRENTLY is only allowed for permanent relations."))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")); /* With NOTHING, WAL does not contain the old tuple. */ replident = rel->rd_rel->relreplident; if (replident == REPLICA_IDENTITY_NOTHING) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot repack relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has insufficient replication identity.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot repack relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has insufficient replication identity.", + RelationGetRelationName(rel))); /* * If the identity index is not set due to replica identity being, PK @@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p) ident_idx = rel->rd_pkindex; if (!OidIsValid(ident_idx)) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot process relation \"%s\"", - RelationGetRelationName(rel)), - errhint("Relation \"%s\" has no identity index.", - RelationGetRelationName(rel)))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot process relation \"%s\"", + RelationGetRelationName(rel)), + errhint("Relation \"%s\" has no identity index.", + RelationGetRelationName(rel))); *ident_idx_p = ident_idx; } @@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, ReadLocalXLogPageNoWaitPrivate *priv; if (errm) - ereport(ERROR, (errmsg("%s", errm))); + ereport(ERROR, + errmsg("%s", errm)); /* * In the decoding loop we do not want to get blocked when there * is no more WAL available, otherwise the loop would become * uninterruptible. */ - priv = (ReadLocalXLogPageNoWaitPrivate *) - ctx->reader->private_data; + priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data; if (priv->end_of_wal) /* Do not miss the end of WAL condition next time. */ priv->end_of_wal = false; else - ereport(ERROR, (errmsg("could not read WAL record"))); + ereport(ERROR, + errmsg("could not read WAL record")); } /* @@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, timeout); if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) - ereport(ERROR, (errmsg("waiting for WAL failed"))); + ereport(ERROR, + errmsg("waiting for WAL failed")); } } @@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target, &tmfd, &lockmode, &update_indexes, false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent UPDATE"))); + ereport(ERROR, + errmsg("failed to apply concurrent UPDATE")); ExecStoreHeapTuple(tup, index_slot, false); @@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target) false /* wal_logical */ ); if (res != TM_Ok) - ereport(ERROR, (errmsg("failed to apply concurrent DELETE"))); + ereport(ERROR, + errmsg("failed to apply concurrent DELETE")); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap, * Should not happen, given our lock on the old relation. */ ereport(ERROR, - (errmsg("identity index missing on the new relation"))); + errmsg("identity index missing on the new relation")); /* Gather information to apply concurrent changes. */ chgdst.rel = NewHeap; @@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid) decoding_worker = palloc0_object(DecodingWorker); if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle)) ereport(ERROR, - (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), - errmsg("out of background worker slots"), - errhint("You might need to increase \"%s\".", "max_worker_processes"))); + errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED), + errmsg("out of background worker slots"), + errhint("You might need to increase \"%s\".", "max_worker_processes")); decoding_worker->seg = seg; decoding_worker->error_mqh = mqh; @@ -3921,8 +3925,8 @@ stop_decoding_worker(void) if (status == BGWH_POSTMASTER_DIED) ereport(FATAL, - (errcode(ERRCODE_ADMIN_SHUTDOWN), - errmsg("postmaster exited during REPACK command"))); + errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("postmaster exited during REPACK command")); shm_mq_detach(decoding_worker->error_mqh); @@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg) seg = dsm_attach(DatumGetUInt32(main_arg)); if (seg == NULL) ereport(ERROR, - (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("could not map dynamic shared memory segment"))); + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("could not map dynamic shared memory segment")); shared = (DecodingWorkerShared *) dsm_segment_address(seg); -- 2.47.3 --pnppmxqkefjd4hu2 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt" ^ permalink raw reply [nested|flat] 971+ messages in thread
end of thread, other threads:[~2026-03-12 15:09 UTC | newest] Thread overview: 971+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-12-01 20:39 room for improvement in amcheck btree checking? Mark Dilger <[email protected]> 2020-12-01 23:26 ` Alvaro Herrera <[email protected]> 2020-12-02 00:38 ` Peter Geoghegan <[email protected]> 2020-12-02 02:03 ` Mark Dilger <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]> 2026-03-12 15:09 [PATCH 3/9] remove excess 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